<% content_for :content do %>

	<!-- widget grid -->
	<section id="widget-grid" class="">
	
		<!-- row -->
		<div class="row">
	
			<!-- NEW WIDGET START -->
			<article class="col-sm-12 col-md-12 col-lg-6">
	
				<!-- Widget ID (each widget will need unique ID)-->
				<div class="jarviswidget jarviswidget-color-orange" id="wid-id-0" data-widget-editbutton="false" data-widget-colorbutton="false" data-widget-deletebutton="false">
					<!-- widget options:
					usage: <div class="jarviswidget" id="wid-id-0" data-widget-editbutton="false">
	
					data-widget-colorbutton="false"
					data-widget-editbutton="false"
					data-widget-togglebutton="false"
					data-widget-deletebutton="false"
					data-widget-fullscreenbutton="false"
					data-widget-custombutton="false"
					data-widget-collapsed="true"
					data-widget-sortable="false"
	
					-->
					<header>
						<span class="widget-icon"> <i class="fa fa-edit"></i> </span>
						<h2>权限组编辑 </h2>
	
					</header>
	
					<!-- widget div-->
					<div>
	
						<!-- widget edit box -->
						<div class="jarviswidget-editbox">
							<!-- This area used as dropdown edit box -->
	
						</div>
						<!-- end widget edit box -->
	
						<!-- widget content -->
						<div class="widget-body">
	
							<%= render :partial => 'form', :locals => { title: "编辑" } %>
	
						</div>
						<!-- end widget content -->
	
					</div>
					<!-- end widget div -->
	
				</div>
				<!-- end widget -->
	
			</article>
			<!-- WIDGET END -->
	
			<!-- NEW WIDGET START -->
			<article class="col-sm-12 col-md-12 col-lg-6">
	
				<!-- Widget ID (each widget will need unique ID)-->
				<div class="jarviswidget jarviswidget-color-blue" id="wid-id-1" data-widget-editbutton="false" data-widget-colorbutton="false" data-widget-deletebutton="false">
					<!-- widget options:
					usage: <div class="jarviswidget" id="wid-id-0" data-widget-editbutton="false">
	
					data-widget-colorbutton="false"
					data-widget-editbutton="false"
					data-widget-togglebutton="false"
					data-widget-deletebutton="false"
					data-widget-fullscreenbutton="false"
					data-widget-custombutton="false"
					data-widget-collapsed="true"
					data-widget-sortable="false"
	
					-->
					<header>
						<span class="widget-icon"> <i class="fa fa-eye"></i> </span>
						<h2>Action管理 </h2>
	
					</header>
	
					<!-- widget div-->
					<div>
	
						<!-- widget edit box -->
						<div class="jarviswidget-editbox">
							<!-- This area used as dropdown edit box -->
	
						</div>
						<!-- end widget edit box -->
	
						<!-- widget content -->
						<div class="widget-body">
	
	          <%= simple_form_for :group, url: add_permission_admin_group_path(@group), :defaults => { :input_html => { :class => "form-control" } }, method: 'post', html: { class: "form-inline" } do |f| %>
	          	<fieldset>
	            <label>Controllers</label>
	            <%= f.input_field :entities, label: false %>
	            <label>Actions</label>
	            <%= f.input_field :actions, label: false, :value => "*" %>    
	            <label>Level</label>
	            <%= f.input_field :level, :value => "1", label: false %>
	            <div class="modal-footer">
	            	<%= f.submit :wrapped, value: "Add", :class => "btn btn-default"%>
	            </div>
	            </fieldset>
	          <% end %>


	
						</div>
						<!-- end widget content -->

						<div class="widget-body">

		          <table class="table table-bordered table-striped">
                <thead>
                  <tr>
                    <th>权限列表</th>
                    <th></th>
                  </tr>
                </thead>
                <tbody>
                <% for permission in @group_permissions -%>
				          <tr class="<%=cycle('bright','')%>">
				            <td>
				              <%= permission.get_label %> 
				            </td>
				            <td><%=link_to "删除",delete_group_permission_admin_group_path(id: @group.id, permission: permission.id),
				              :method => "post" %></td>
				          </tr>
				        <% end %>
                </tbody>
              </table>
              <div class="dt-row dt-bottom-row"><div class="row"><div class="col-sm-6"><div class="dataTables_info" id="datatable_fixed_column_info"></div></div><div class="col-sm-6 text-right"><%= paginate @group_permissions %></div></div></div>
						</div>
						
	
					</div>
					<!-- end widget div -->
	
				</div>
				<!-- end widget -->
	
			</article>
			<!-- WIDGET END -->
	
		</div>
	
		<!-- end row -->
	
		<!-- row -->
	
		<div class="row">
	
		</div>
	
		<!-- end row -->
	
	</section>
	<!-- end widget grid -->
<% end %>

<% content_for :js do %>

  <script type="text/javascript">

    $('#group_sub_ids').select2({width: "100%"});

  </script>
<% end %>